<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>cowlogin</title>
    <!--<script src="cowexternal.js">
    </script>-->
    <script type="text/javascript">
        var xmlhttp = null;
        
        function GetXmlHttpObject()
        {
            if(null != xmlhttp)
                return xmlhttp;
                
            try{
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP');
            }catch(e){
                try{
                    xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
                }catch(e){
                    xmlhttp = new XMLHttpRequest();  
                }
            }
            
            return xmlhttp;
        }
        
        function Login()
        {
            var usertype = "cowid";//document.getElementById('usertype').value;
            var username = document.getElementById('username').value;
            var password = document.getElementById('password').value;
            
            var loginbody = "<request method=\"Login\"><usertype>"+usertype+"</usertype><userid>"+
                                username+"</userid><password>"+password+"</password></request>";
            
            xmlhttp = GetXmlHttpObject();
            
            if(null != xmlhttp)
            {
                xmlhttp.open("POST", "/cowwork", false);
                xmlhttp.send(loginbody);//xmlhttp.status;xmlhttp.statusText;xmlhttp.responseText
                alert(xmlhttp.responseText);
            }
        }
    </script>
</head>

<body>
    <div style="width:800px; height:auto; margin:10px auto">
        <div style="background:url(logo.gif) no-repeat; width:800px; height:74px">
            <div style="padding:26px 0 0 90px">
               <b>欢迎</b>
            </div>
        </div>
        <div><form action="/cowwork?method=Login" method="POST" name="login" id="login">
            <table cellspacing="10">
                <tr>
                    <td align="middle">帐&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号</td>
                    <td><input name="username" type="text" id="username" style="width:165px" value=""/></td>
                </tr>
                <tr>
                    <td align="middle">密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码</td>
                    <td><input name="password" type="password" id="password" style="width:165px" maxlength=6/></td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td align="middle"><input name="loginbtn" type="button" id="loginbtn" onclick="Login()" value="登录"/></td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td align="middle"><input name="loginsbm" type="submit" id="loginsbm" value="submit"/></td>
                </tr>                
            </table>
        </form></div>
    </div>
</body>

</html>
